#!/bin/bash

rm -rf log/

echo "> Compilando programa e gerando jar"
ant clean
ant
mkdir log

gcc -c runtime.c

echo \> Executando testes com codigo correto

for i in $( ls -l tests | grep ^- | awk '{print $8}' ); do
  echo "run $i"
  #echo "teste $i" &> log/tests.log
  java -jar main.jar tests/$i
  nasm -felf minijava.asm
  gcc minijava.o runtime.o
  ./a.out
  rm a.out minijava.asm minijava.o
done



